import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
import { renderer } from "./renderer.js";

const width = window.innerWidth; //窗口文档显示区的宽度
const height = window.innerHeight; //窗口文档显示区的高度

const camera = new THREE.PerspectiveCamera(45, width / height, 0.01, 30000);
camera.position.set(-0.68, 10.33, 40.9); //通过相机控件OrbitControls旋转相机，选择一个合适场景渲染角度
const x = -9.29,
  y = 2.38,
  z = -0.39;
camera.lookAt(x, y, z);
const controls = new OrbitControls(camera, renderer.domElement); //创建控件对象

// controls.target.set(x,y , z);
// controls.update();//update()函数内会执行camera.lookAt(controls.targe)

export { camera, controls };
